<!DOCTYPE HTML>
<html>
<head>
    <title>帮教管理--危险评估页面</title>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8" />
    <script src="/webjars/miniui/boot.js" type="text/javascript"></script>
    <link href="/static/css/resource.css" rel="stylesheet" type="text/css" />
    <link href="/static/css/default.css" rel="stylesheet" type="text/css" />
    <script src="/static/js/common/common.js" type="text/javascript"></script>
</head>
<style>
    .delBtn {
        border:1px solid #ff2120;
        border-radius:10px;
        font-size:8px;
        line-height:20px;
        font-weight:bold;
        color:#ff4634;
    }
    .editBtn {
        border:1px solid #018d00;
        border-radius:10px;
        font-size:8px;
        line-height:20px;
        font-weight:bold;
        color:#00a60a;
    }
</style>
<body onload="onLoad()">
<div class="mini-fit">
    <div id="editform2" class="form" style="margin-left: 200px;margin-top: 20px;">
        <form id="form2" method="post">
            <div id="editform21" class="form">
                <table class="form-table" width="100%">
                    <tr>
                        <td style="line-height: 30px;"><span style="font-size: 18px">${pname!''}</span>/${sex!''}</td>
                        <td width="50%"><span style="color: #8B8B8B">危险评估:</span>
                            <#if  zongfen ?? && zongfen='1'><span style="color: red">高危险性人员</span>
                            <#elseif zongfen ??  && zongfen='2'><span style="color: #ee623c ">较高危险性人员</span>
                            <#elseif zongfen ??  && zongfen='3'><span style="color: #ff5a39 ">一般等级危险性人员</span>
                            <#elseif zongfen ??  && zongfen='4'><span style="color: #2b7dbc ">低等级危险性人员</span>
                            </#if>
                        </td>
                    </tr>
                    <tr>
                        <td width="50%" style="line-height: 30px;"><span style="color: #8B8B8B">身份证号:</span>${idnum!''}
                        </td>
                        <td width="50%"><span style="color: #8B8B8B">户籍地址:</span>${hjdz!''}</td>
                    </tr>
                    <tr>
                        <td width="50%" style="line-height: 30px;"><span style="color: #8B8B8B">出生日期:</span>${age!''}
                        </td>
                        <td width="50%"><span style="color: #8B8B8B">居住地址:</span>${juzhudi!''}</td>
                    </tr>
                </table>
            </div>
        </form>
    </div>

    <form id="form" method="post" style="padding:10px;">
        <!-- 用户 编辑框START-->
        <div id="editform" class="form">
            <input id="id" name="id" class="mini-hidden" value="${id!''}" style="width: 100%;" readonly />
            <input id="pid" name="pid" class="mini-hidden" value="${priNum!''}" style="width: 100%;" readonly />
            <table class="form-table" width="100%">
                <tr>
                    <td style="width:  30%" align="right"><span style="font-size: 15px;line-height: 30px;font-weight: bold">评估内容&emsp;&emsp;&emsp;&emsp;</span>
                    </td>
                    <td style="width: 70%">

                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">身份证号:</td>
                    <td width="70%" class="input">
                        <input name="num" id="num" class="mini-radiobuttonlist" value="${num!''}"
                               data="[{ id: 1, name: '不正确' },{ id: 2, name: '正确' }]"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">住址:</td>
                    <td width="70%" class="input">
                        <input name="addr" id="addr" class="mini-radiobuttonlist" value="${addr!''}"
                               data="[{ id: 1, name: '不正确' },{ id: 2, name: '正确' }]"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">年龄:</td>
                    <td width="70%" class="input">
                        <input name="age" id="age" class="mini-radiobuttonlist" value="${birth!''}"
                               data="[{ id: 1, name: '18岁以下' },{ id: 2, name: '18-35岁' },{ id: 3, name: '36-45岁' },{ id: 4, name: '46岁以上' }]"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">文化程度:</td>
                    <td width="70%" class="input">
                        <input name="edu" id="edu" class="mini-radiobuttonlist" value="${edu!''}"
                               data="[{ id: 1, name: '小学以下' },{ id: 2, name: '初中' },{ id: 3, name: '高中' },{ id: 4, name: '大专以上' }]"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">就业情况:</td>
                    <td width="70%" class="input">
                        <input name="jiuye" id="jiuye" class="mini-radiobuttonlist" value="${jiuye!''}"
                               data="[{ id: 1, name: '不愿就业' },{ id: 2, name: '无能力就业' },{ id: 3, name: '愿意就业但未就业' },{ id: 4, name: '已就业' }]"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">生活来源:</td>
                    <td width="70%" class="input">
                        <input name="shenghuo" id="shenghuo" class="mini-radiobuttonlist" value="${shenghuo!''}"
                               data="[{ id: 1, name: '无固定生活来源' },{ id: 2, name: '依靠政府救助' },{ id: 3, name: '依靠家庭' },{ id: 4, name: '依靠自身工作收入' }]"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">固定住所:</td>
                    <td width="70%" class="input">
                        <input name="zhusuo" id="zhusuo" class="mini-radiobuttonlist" value="${zhusuo!''}"
                               data="[{ id: 1, name: '有' },{ id: 2, name: '无' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">身体状况:</td>
                    <td width="70%" class="input">
                        <input name="shenti" id="shenti" class="mini-radiobuttonlist" value="${shenti!''}"
                               data="[{ id: 1, name: '严重疾病或身体残疾' },{ id: 2, name: '患病花费较大或影响就业' },{ id: 3, name: '一般慢性疾病' },{ id: 4, name: '健康' }]"
                               required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">婚姻情况</td>
                    <td width="70%" class="input">
                        <input name="hunyin" id="hunyin" class="mini-radiobuttonlist" value="${hunyin!''}"
                               data="[{ id: 1, name: '离异、丧偶、大龄未婚(25周岁以上)' },{ id: 2, name: '已婚或25周岁以下未婚(家庭稳定)' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">家庭成员关系:</td>
                    <td width="70%" class="input">
                        <input name="jiatingc" id="jiatingc" class="mini-radiobuttonlist" value="${jiatingc!''}"
                               data="[{ id: 1, name: '无家可归，无亲可投' },{ id: 2, name: '单亲' },{ id: 3, name: '家庭不睦' },{ id: 4, name: '家庭和睦' }]"
                               required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">家庭经济状况:</td>
                    <td width="70%" class="input">
                        <input name="jiatingj" id="jiatingj" class="mini-radiobuttonlist" value="${jiatingj!''}"
                               data="[{ id: 1, name: '低于当地最低生活标准' },{ id: 2, name: '无正当职业或收入不稳定' },{ id: 3, name: '收入稳定，能满足基本生活要求' },{ id: 4, name: '收入比高' }]"
                               required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">家庭成员犯罪记录:</td>
                    <td width="70%" class="input">
                        <input name="jiatingf" id="jiatingf" class="mini-radiobuttonlist" value="${jiatingf!''}"
                               data="[{ id: 1, name: '有' },{ id: 2, name: '无' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">家庭成员精神病史:</td>
                    <td width="70%" class="input">
                        <input name="jiatingb" id="jiatingb" class="mini-radiobuttonlist" value="${jiatingb!''}"
                               data="[{ id: 1, name: '有' },{ id: 2, name: '无' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">违法犯罪类型:</td>
                    <td width="70%" class="input">
                        <input name="fanzui" id="fanzui" class="mini-radiobuttonlist" value="${fanzui!''}"
                               data="[{ id: 1, name: '严重暴力犯罪、团伙作案、主犯、涉黑恶、涉枪、涉毒、涉邪教、侵财、“三假”人员' },{ id: 2, name: '一般性犯罪' },{ id: 3, name: '偶犯、非暴力犯罪 '}]"
                               required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">主观恶性程度:</td>
                    <td width="70%" class="input">
                        <input name="exing" id="exing" class="mini-radiobuttonlist" value="${exing!''}"
                               data="[{ id: 1, name: '故意犯罪' },{ id: 4, name: '过失犯罪' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">是否累犯:</td>
                    <td width="70%" class="input">
                        <input name="leifan" id="leifan" class="mini-radiobuttonlist" value="${leifan!''}"
                               data="[{ id: 1, name: '是' },{ id: 2, name: '否' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">心理健康状况:</td>
                    <td width="70%" class="input">
                        <input name="xinli" id="xinli" class="mini-radiobuttonlist" value="${xinli!''}"
                               data="[{ id: 1, name: '性格严重扭曲，患有严重心理疾病' },{ id: 2, name: '患有明显心理疾病' },{ id: 3, name: '轻微心理问题' },{ id: 4, name: '健康' }]"
                               required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">自控能力:</td>
                    <td width="70%" class="input">
                        <input name="zikong" id="zikong" class="mini-radiobuttonlist" value="${zikong!''}"
                               data="[{ id: 1, name: '性格急躁，冲动，难以自控' },{ id: 2, name: '自控能力差或遇事不能自控' },{ id: 3, name: '能够较好的自我控制' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">法律知识或法制观念:</td>
                    <td width="70%" class="input">
                        <input name="falv" id="falv" class="mini-radiobuttonlist" value="${falv!''}"
                               data="[{ id: 1, name: '无法律知识或法制观念（法盲）' },{ id: 2, name: '法律知识欠缺，法制观念淡薄' },{ id: 3, name: '熟知法律，具有较强的法制观念' }]"
                               required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">对现实社会的心态:</td>
                    <td width="70%" class="input">
                        <input name="xianshi" id="xianshi" class="mini-radiobuttonlist" value="${xianshi!''}"
                               data="[{ id: 1, name: '对社会极度不满或严重仇视社会' },{ id: 2, name: '偶尔对社会流露不满' },{ id: 3, name: '能够正确看待社会现实' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">交往范围:</td>
                    <td width="70%" class="input">
                        <input name="jiaowangfw" id="jiaowangfw" class="mini-radiobuttonlist" value="${jiaowangfw!''}"
                               data="[{ id: 1, name: '社会关系复杂' },{ id: 2, name: '存在不良交友情况' },{ id: 3, name: '无不良交友情况' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">社会交往态度:</td>
                    <td width="70%" class="input">
                        <input name="jiaowangtd" id="jiaowangtd" class="mini-radiobuttonlist" value="${jiaowangtd!''}"
                               data="[{ id: 1, name: '消极回避' },{ id: 2, name: '正常社会交往' },{ id: 3, name: '积极主动' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">刑期范围:</td>
                    <td width="70%" class="input">
                        <input name="xingqi" id="xingqi" class="mini-radiobuttonlist" value="${xingqi!''}"
                               data="[{ id: 1, name: '无期徒刑，死缓' },{ id: 2, name: '10-20年' },{ id: 3, name: '3-10年（不含10年）' },{ id: 4, name: '1-3年（不含3年）' },{ id: 5, name: '1年以下' }]"
                               required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">认罪服法态度:</td>
                    <td width="70%" class="input">
                        <input name="renzui" id="renzui" class="mini-radiobuttonlist" value="${renzui!''}"
                               data="[{ id: 1, name: '不认罪' },{ id: 2, name: '认罪服法' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">改造表现:</td>
                    <td width="70%" class="input">
                        <input name="gaizhao" id="gaizhao" class="mini-radiobuttonlist" value="${gaizhao!''}"
                               data="[{ id: 1, name: '受到加刑（加期）处罚' },{ id: 2, name: '无减刑（减期）' },{ id: 3, name: '减刑（减期）' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">职业技能:</td>
                    <td width="70%" class="input">
                        <input name="zhiye" id="zhiye" class="mini-radiobuttonlist" value="${zhiye!''}"
                               data="[{ id: 1, name: '无职业技能且不愿学习' },{ id: 2, name: '掌握一定的职业技能，但未取得相应的资格证书' },{ id: 3, name: '掌握一项以上职业技能或取得相关专业技能证书' }]"
                               required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">监所评估:</td>
                    <td width="70%" class="input">
                        <input name="jiansuo" id="jiansuo" class="mini-radiobuttonlist" value="${jiansuo!''}"
                               data="[{ id: 1, name: '重点帮教对象' },{ id: 2, name: '一般帮教对象' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">回归去向:</td>
                    <td width="70%" class="input">
                        <input name="huigui" id="huigui" class="mini-radiobuttonlist" value="${huigui!''}"
                               data="[{ id: 1, name: '下落不明' },{ id: 2, name: '人户分离' },{ id: 3, name: '回原籍' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">对安置帮教态度:</td>
                    <td width="70%" class="input">
                        <input name="taidu" id="taidu" class="mini-radiobuttonlist" value="${taidu!''}"
                               data="[{ id: 1, name: '不配合' },{ id: 2, name: '消极配合' },{ id: 3, name: '积极配合' }]" required="true"
                               textField="name" valueField="id" required="true" />
                    </td>
                </tr>
                <tr>
                    <td width=" 30%" align="right" style="line-height: 30px;">评估日期:</td>
                    <td width="70%" class="input">
                        <input name="pingdate" id="pingdate" class="mini-datepicker" value="${pingdate!''}" required="true" />
                    </td>
                </tr>

            </table>
        </div>
    </form>

    <div>
        <br /><br />
    </div>
    <div style="padding:2px;margin: 0 auto;text-align: center">
        <a class="mini-button" iconCls="fa-save" plain="true" onclick="saveData()">保存</a>
        <a class="mini-button" iconCls="fa-undo" plain="true" onclick="close()">取消</a>
    </div>
    <div>
        <br />
    </div>
</div>
<script type="text/javascript">
    mini.parse();

    var form = new mini.Form("form");
    var form2 = new mini.Form("form2");
    var pidObj = mini.get("pid");

    function onLoad() {
    }

    function saveData() {
        form.validate();
        if (form.isValid() == false) {
            return;
        }
        var data = form.getData();
        var priNum = pidObj.getValue();
        if (priNum) {
            data.pid = priNum;
        }
        data.zongfen = getFenshu(data);
        var json = mini.encode(data);
        $.ajax({
            url: "/azbj/azbjgl/bjgzgl/savePgInfo",
            type: "post",
            data: {data: json},
            success: function (result) {
                mini.alert("保存成功");
                close("close");
            }
        });
    }

    function getFenshu(data) {
        var zongfen = 0;
        zongfen += data.num == 1 ? 2 : 0;//身份证号
        zongfen += data.addr == 1 ? 2 : 0;//住址
        zongfen += data.age == 1 ? 5 : data.age == 2 ? 4 : data.age == 3 ? 3 : 1;//年龄
        zongfen += data.edu == 1 ? 5 : data.edu == 2 ? 4 : data.edu == 3 ? 3 : 2;//文化程度
        zongfen += data.jiuye == 1 ? 3 : data.jiuye == 2 ? 2 : data.jiuye == 3 ? 1 : 0;//就业情况
        zongfen += data.shenghuo == 1 ? 3 : data.shenghuo == 2 ? 2 : data.shenghuo == 3 ? 1 : 0;//生活来源
        zongfen += data.zhusuo == 1 ? 0 : 3;//固定住所
        zongfen += data.shenti == 1 ? 3 : data.shenti == 2 ? 2 : data.shenti == 3 ? 1 : 0;//身体状况
        zongfen += data.hunyin == 1 ? 3 : 0;//婚姻状况
        zongfen += data.jiatingc == 1 ? 4 : data.jiatingc == 2 ? 3 : data.jiatingc == 3 ? 2 : 0;//家庭成员关系
        zongfen += data.jiatingj == 1 ? 4 : data.jiatingj == 2 ? 3 : data.jiatingj == 3 ? 2 : 0;//家庭经济状况
        zongfen += data.jiatingf == 1 ? 3 : 0;//家庭成员犯罪记录
        zongfen += data.jiatingb == 1 ? 2 : 0;//家族精神病史
        zongfen += data.fanzui == 1 ? 5 : data.fanzui == 2 ? 3 : 0;//违法犯罪类型
        zongfen += data.exing == 1 ? 4 : 1;//主观恶性程度
        zongfen += data.leifan == 1 ? 4 : 1;//是否累犯
        zongfen += data.xinli == 1 ? 5 : data.xinli == 2 ? 4 : data.xinli == 3 ? 2 : 0;//心理健康状况
        zongfen += data.zikong == 1 ? 4 : data.zikong == 2 ? 2 : 1;//自控能力
        zongfen += data.falv == 1 ? 4 : data.falv == 2 ? 3 : 1;//法律知识或法制观念
        zongfen += data.xianshi == 1 ? 4 : data.xianshi == 2 ? 4 : 0;//对现实社会心态
        zongfen += data.jiaowangfw == 1 ? 3 : data.jiaowangfw == 2 ? 2 : 0;//交往范围
        zongfen += data.jiaowangtd == 1 ? 3 : data.jiaowangtd == 2 ? 1 : 0;//社会交往态度
        zongfen += data.xingqi == 1 ? 5 : data.xingqi == 2 ? 4 : data.xingqi == 3 ? 3 : data.xingqi == 4 ? 2 : 1;//刑期
        zongfen += data.renzui == 1 ? 2 : 0;//认罪服法态度
        zongfen += data.gaizhao == 1 ? 4 : data.gaizhao == 2 ? 2 : 0;//改造表现
        zongfen += data.zhiye == 1 ? 4 : data.zhiye == 2 ? 2 : 0;//职业技能
        zongfen += data.jiansuo == 1 ? 3 : 1;//监所评估
        zongfen += data.huigui == 1 ? 3 : data.huigui == 2 ? 2 : 1;//回归去向
        zongfen += data.taidu == 1 ? 3 : data.taidu == 2 ? 1 : 0;//态度
        return zongfen;
    }

    function close(action) {
        if (window.CloseOwnerWindow) {
            window.CloseOwnerWindow(action);
        } else {
            window.close();
        }
    }

    function getQueryName() {
        var priNum = queryNameObj.getValue();
        if (priNum) {
            document.getElementById("editform2").style.display = "block";
        } else {
            document.getElementById("editform2").style.display = "none";
        }
        $.ajax({
            url: "/azbj/bjdxInfo/qbrygl/query/getInfo?priNum=" + priNum,
            type: "post",
            success: function (result) {
                var info = result.data;
                var data = {};
                data.name = info.pname;
                if(info.sex==0){
                    data.sex="未知的性别";
                }else if(info.sex==1){
                    data.sex="男性";
                }else if(info.sex==2){
                    data.sex="女性";
                }else {
                    data.sex="未说明的性别";
                }
                data.idnum = info.idnum;
                data.age = info.nl;
                var hujidi = "";
                if (info.nativeproName) {
                    hujidi += info.nativeproName;
                }
                if (info.nativecityName) {
                    hujidi += info.nativecityName;
                }
                if (info.nativecouName) {
                    hujidi += info.nativecouName;
                }
                if (info.nativevillName) {
                    hujidi += info.nativevillName;
                }
                if (info.nativenum) {
                    hujidi += info.nativenum;
                }
                data.hujidi = hujidi;
                var juzhudi = "";
                if (info.placeproName) {
                    juzhudi += info.placeproName;
                }
                if (info.placecityName) {
                    juzhudi += info.placecityName;
                }
                if (info.placecouName) {
                    juzhudi += info.placecouName;
                }
                if (info.placevillName) {
                    juzhudi += info.placevillName;
                }
                if (info.placenum) {
                    juzhudi += info.placenum;
                }
                data.juzhudi = juzhudi;
                form2.setData(data);
            }
        });
    }
</script>
</body>
</html>